<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
$act=$_GET['act'];
$wzxx_title ='登陆-'.$wzxx_title.'';
$wzxx_gj    ='登陆-'.$wzxx_gj.'';
$wzxx_ms    ='登陆-'.$wzxx_ms.'';
if($user_uid){
	 $pdid="1";
}else if($act == 'ok' ){
	  if(!$_POST['username']){
	  $userpass=$_GET['userpass'];
	  $username=$_GET['username'];
	  }else{
	  $userpass=$_POST['userpass'];
	  $username=$_POST['username'];
	  }
	  if(empty($userpass) or empty($username)){
		   $pdid="2";
	  }else if($_COOKIE['cwcsmm']){
		   $pdid="4";
	  }else{
	  	 $dluid=$user_class->user_login($username,$userpass);
	     if($dluid > '0' ){
	     	  $ssid=explode('*',$dluid);
	        $dlname=$user_class->user_name($ssid[0]);
	        $userpass=$ssid[1];
	        $url_a=$_COOKIE['url'];
	        $pdid='5';
	        setcookie('cwcsmm','');
	        setcookie('cwcs','');
	     	  setcookie('url','');
	     }else{
	        $pdid='3';
	        $dlcwcs=$_COOKIE['cwcs']+1;
	        if($dlcwcs > '5'){
	        	 setcookie('cwcsmm','1',time()+3600);
	        	 setcookie('cwcs','');
	        }
	        setcookie('cwcs',$dlcwcs,time()+86400);
	     }
    }
}else{
	if(!preg_match('/login/',$url_a)){
	      if(!$url_a){
	        $url_a='index.php?';
	      }
	      if(substr($url_a, -1) == '/'){
	        $url_a=$url_a.'?';
	      }
	      setcookie('url',$url_a);
	}
}
@include template('head');
@include template('user/user_login');
@include template('foot');
?>